<template>
  <ul class="todo-list">
  
    <li  v-for="item in list" :key="item.id" :class="{ completed: item.isDone }">
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{item.name}}</label>
       
        <button @click="$emit('del',item.id)" class="destroy" ></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
   props:{
      list:{
        required: true,
        type:Array
      }
   }
}
</script>